package org.elsfs.cloud.common.mybatis.ext.sql.support.condition;


import org.elsfs.cloud.common.util.lang.NamingCase;

/**
 * 子查询排除范围条件
 *

 */
public class NotInSubQueryConditionItem extends InSubQueryConditionItem {

    public NotInSubQueryConditionItem(String leftField, String inSql) {
        super(leftField, inSql);
    }

    /**
     * 构建SQL片段
     *
     * @return SQL片段
     */
    @Override
    public String buildSqlFragment() {
        return String.format(
            "%s NOT IN (%s)",
            NamingCase.toUnderlineCase(this.leftField),
            this.inSql
        );
    }
}
